<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>付款申请单</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div>
        <form id="capPayInfo_form">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">基本信息</span>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付款代收</div>
                    <div class="field">
                        <input type="checkbox" name="isFstCol" id="isFstCol"
                               <c:if test="${capPayInfoVO.isFstCol==1}">checked</c:if>>
                        <span class="requiredSymbol">是</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付金额(元)</div>
                    <div class="field">
                        <span id="initPayAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付不含咨询费(元)</div>
                    <div class="field">
                        <span id="initFstShowAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">设备款(元)</div>
                    <div class="field">
                        <span id="pAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">所属事业部</div>
                    <div class="field">
                        <span>${capPayInfoVO.buOrgCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">项目类型</div>
                    <div class="field">
                        <span>${capPayInfoVO.prjTypCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">客户名称</div>
                    <div class="field">
                        <a style="cursor: pointer;" onclick="showCstDtl(${capPayInfoVO.cstId})" class="link">
                            <span>${capPayInfoVO.cstNm}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">融资租赁合同号</div>
                    <div class="field">
                        <a href="javascript:toPrjDetail(${capPayInfoVO.prjId})" class="link">
                            <span>${capPayInfoVO.contNo}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">支付表号</div>
                    <div class="field">
                        <a href="javascript:showPrjPrdPaySchDtl()" class="link">
                            <span>${capPayInfoVO.paySchNo}</span>
                        </a>
                        <input type="text" style="display: none;" id="paySchId" name="paySchId"
                               value="${capPayInfoVO.paySchId}">
                        <input type="text" style="display: none;" id="cstMgrOrgCd" name="cstMgrOrgCd"
                               value="${capPayInfoVO.cstMgrOrgCd}">
                        <input type="text" style="display: none;" id="buOrgCd" name="buOrgCd"
                               value="${capPayInfoVO.buOrgCd}">
                        <input type="text" style="display: none;" id="prjPrdId" name="prjPrdId"
                               value="${capPayInfoVO.prjPrdId}">
                        <input type="text" style="display: none;" id="prjId" name="prjId" value="${capPayInfoVO.prjId}">
                        <input name="payTypCd" id="payTypCd" value="${payTypCd}" type="text" style="display:none;">
                        <input name="payStsCd" id="payStsCd" value="${capPayInfoVO.payStsCd}" type="text"
                               style="display:none;">
                        <input name="prjPrdDtlId" id="prjPrdDtlId" value="${capPayInfoVO.prjPrdDtlId}" type="text"
                               style="display:none;">
                        <input name="payAmt" id="payAmt" value="${capPayInfoVO.payAmt}" type="text"
                               style="display:none;">
                    </div>
                </div>
                <c:if test="${spFlag==1 || checkSp==1 }">
	                <div class="fieldBox col_33">
	                    <div class="label"><span class="requiredSymbol">上牌信息</span></div>
	                    <div class="field">
	                    	<c:if test="${spState==1 }">
	                        	<span class="requiredSymbol">已上牌</span>
	                    	</c:if>
	                    	<c:if test="${spState==0 }">
	                        	<span class="requiredSymbol">未上牌</span>
	                    	</c:if>
	                    	<c:if test="${spState==0 && spFlag==1 && isExistSp==1 }">
			                    <a href="javascript:modifySp(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span>修改上牌信息</span>
		                        </a>
	                    	</c:if>
	                    	<c:if test="${spState==0 && spFlag==1 && isExistSp==0 }">
			                    <a href="javascript:addSp(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span>添加上牌信息</span>
		                        </a>
	                    	</c:if>
	                    	<c:if test="${spFlag==0 && isExistSp==1 }">
			                    <a href="javascript:showSp(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span>查看上牌信息</span>
		                        </a>
	                    	</c:if>
	                    </div>
	                </div>
                </c:if>
            </div>

            <div>
                <div id="pageInTab" class="pageInTab">
                    <div tabid="payTab" title="付款通知" lselected="true">
                    
                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">${accItem.purpCdNm}信息</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款方类型</div>
                                    <div class="field">
                                        <input name="payeeTypCd${accItem.purpCd}" id="payeeTypCd${accItem.purpCd}"
                                               data-value="${accItem.payeeTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>

                                <div class="fieldBox col_66">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input name="rcptUnt${accItem.purpCd}" id="rcptUnt${accItem.purpCd}"
                                               data-value="${accItem.rcptUnt}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">账户类型</div>
                                    <div class="field">
                                        <input name="bkAccTypCd${accItem.purpCd}" id="bkAccTypCd${accItem.purpCd}"
                                               data-value="${accItem.bkAccTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input name="payeeBkNm${accItem.purpCd}" id="payeeBkNm${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNm}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input name="payeeBkNo${accItem.purpCd}" id="payeeBkNo${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNo}" validate="{required:true,number:true}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input name="accNo${accItem.purpCd}" id="accNo${accItem.purpCd}"
                                               data-value="${accItem.accNo}" validate="{required:true,number:false}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                    <input id="payeeId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.id}">
                                    <input id="bkId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.bkId}">
                                    <input id="purpCd${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.purpCd}">
                                </div>
                            </div>
                        </c:forEach>
                        
                        <!-- 挂靠公司信息 -->
                        
                        <c:forEach var="accItem" items="${lnkCompList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">车立行(${accItem.purpCdNm})信息</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款方类型</div>
                                    <div class="field">
                                        <input name="payeeTypCd${accItem.purpCd}" id="payeeTypCd${accItem.purpCd}"
                                               data-value="${accItem.payeeTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>

                                <div class="fieldBox col_66">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input name="rcptUnt${accItem.purpCd}" id="rcptUnt${accItem.purpCd}"
                                               data-value="${accItem.rcptUnt}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">账户类型</div>
                                    <div class="field">
                                        <input name="bkAccTypCd${accItem.purpCd}" id="bkAccTypCd${accItem.purpCd}"
                                               data-value="${accItem.bkAccTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input name="payeeBkNm${accItem.purpCd}" id="payeeBkNm${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNm}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input name="payeeBkNo${accItem.purpCd}" id="payeeBkNo${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNo}" validate="{required:true,number:true}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input name="accNo${accItem.purpCd}" id="accNo${accItem.purpCd}"
                                               data-value="${accItem.accNo}" validate="{required:true,number:false}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                    <input id="payeeId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.id}">
                                    <input id="bkId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.bkId}">
                                    <input id="purpCd${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.purpCd}">
                                </div>
                            </div>
                        </c:forEach>
                        
                          <%--  <div class="fieldset1 tabel_col clearFix">
                            <!-- 挂靠公司id -->
                            <input id="prjLnkCompBkAccId" name="prjLnkCompBkAccId" value="${PrjLnkComp.id}" type="text" style="display: none;">
                            <!--挂靠公司账户类型  -->
                            <input id="purpcd" name="purpcd" type="text" style="display: none;">
                                <div class="caption">
                                    <span class="title">${ZZKPpurpCdNm}信息</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款方类型</div>
                                    <div class="field">
                                        <input name="ZZKPpayeeTypCd" id="ZZKPpayeeTypCd"
                                               data-value="${ZZKPpayeeTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>

                                <div class="fieldBox col_66">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input name="ZZKPrcptUnt" id="ZZKPrcptUnt"
                                               data-value="${ZZKPrcptUnt}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">账户类型</div>
                                    <div class="field">
                                        <input name="ZZKPbkAccTypCd" id="ZZKPbkAccTypCd"
                                               data-value="${ZZKPbkAccTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input name="ZZKPpayeeBkNm" id="ZZKPpayeeBkNm"
                                               data-value="${ZZKPpayeeBkNm}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input name="ZZKPpayeeBkNo" id="ZZKPpayeeBkNo"
                                               data-value="${ZZKPpayeeBkNo}" validate="{required:true,number:true}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input name="ZZKPaccNo" id="ZZKPaccNo" data-value="${ZZKPaccNo}" validate="{required:true,number:false}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                
                                </div>
                            </div>  --%>
                   <!-- 挂靠公司信息 -->
                   
                        <div class="fieldset1 tabel_col clearFix">
                            <div class="fieldBox col_100">
                                <div class="label">付款备注</div>
                                <div class="field">
                                      <textarea name="payRem" id="payRem" class="ui-textarea l-textarea"
                                                value="${capPayInfoVO.payRem}"
                                                rows="2" cols="120" style="width: 97%;"
                                                validate="{required:false,maxlength:240}">${capPayInfoVO.payRem}</textarea>
                                </div>
                            </div>
                        </div>

                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">付款信息(${accItem.purpCdNm})</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">应付款金额(元)</div>
                                    <div class="field">
                                        <input name="payAmts${accItem.purpCd}" id="payAmts${accItem.purpCd}"
                                               class="ui-textbox" value="" type="text" data-value="${accItem.payAmts}"
                                               data-tofix="2" validate="{required:true,number:true}" readonly>
                                        <input id="payAmt${accItem.purpCd}" type="text" value="${accItem.payAmt}"
                                               style="display: none;">
                                        <input id="rebateAmt${accItem.purpCd}" type="text" value="${accItem.rebateAmt}"
                                               style="display: none;">
                                    </div>
                                </div>
                                <div class="fieldBox col_66_auto">
                                    <div class="label">付款方式</div>
                                    <div class="field">
                                        <input id="payWayCd${accItem.purpCd}" data-value="${accItem.payWayCd}"
                                               validate="{required:false}" placeholder="请选择" ltype="combobox">
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">实付金额(元)</div>
                                    <div class="field">
                                        <input id="actPayAmt${accItem.purpCd}" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${accItem.actPayAmts}"
                                               validate="{required:false,number:true}">
                                    </div>
                                </div>
                                <div class="fieldBox col_66_auto">
                                    <div class="label">实付时间</div>
                                    <div class="field">
                                        <input id="actPayTms${accItem.purpCd}" type="text" class="ui-datepicker"
                                               value="${accItem.actPayTms}"
                                               validate="{required:false}">
                                    </div>
                                </div>
                            </div>
                        </c:forEach>
                       
                    </div>
                    <div tabid="leaseTab" title="租赁物信息(${capPayInfoVO.prdCount})">
                        <iframe frameborder="0" id="lease" name="lease" src=""></iframe>
                    </div>
                    <div tabid="hisTab" title="历史付款记录(${capPayInfoVO.payCount})">
                        <iframe frameborder="0" id="hispay" name="hispay" src=""></iframe>
                    </div>
                    <div tabid="mateTab" title="放款资料(${capPayInfoVO.fileCount})">
                        <iframe frameborder="0" id="material" name="material" src=""></iframe>
                    </div>
                    <div tabid="insTab" title="查看保单">
                        <iframe frameborder="0" id="insDtl" name="insDtl" src=""></iframe>
                    </div>
                    <c:if test="${not empty bizFlag and bizFlag == '2'}">
                        <div tabid="bankTab" title="银行代扣卡">
                            <iframe frameborder="0" id="bankDtl" name="bankDtl" src=""></iframe>
                        </div>
                    </c:if>
                </div>
            </div>

            <div class="btnsBox" style="text-align: center;">
                <span id="saveCapPayInfoBtn" class="sq-button sq-button-round">保存</span>
                <span id="startFlowBtn" class="sq-button sq-button-round">发起流程</span>
                <span id="backCapPayInfoBtn" class="sq-button sq-button-round">返回</span>
                <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
                <c:if test="${showHtOpn==1}">
                    <span id="contractOpn" class="sq-button sq-button-round"
                          onclick="contractOpnStart();">放款合同通过意见</span>
                </c:if>
                <c:if test="${showDyOpn==1}">
                    <span id="mortGageOpn" class="sq-button sq-button-round"
                          onclick="mortGageOpnStart();">放款抵押通过意见</span>
                </c:if>
                <c:if test="${showRejOpn==1}">
                    <span id="rejOpn" class="sq-button sq-button-round" onclick="rejOpnStart();">驳回意见</span>
                </c:if>
            </div>

            <input name="cstId" id="cstId" type="text" style="display: none;" value="${capPayInfoVO.cstId}">
            <input name="splId" id="splId" type="text" style="display: none;" value="${capPayInfoVO.splId}">
        </form>
    </div>
</div>

<script>
    var pageInTab = null;
    var pageInApp = {};
    var loadedTabs = [];
    var fields = ['payeeTypCd', 'rcptUnt', 'bkAccTypCd', 'payeeBkNm', 'payeeBkNo', 'accNo', 'payeeId', 'bkId', 'purpCd', 'payAmt', 'actPayAmt', 'actPayTms', 'payWayCd'];
    var form = null;
    var counts = [];
    var bizFlag = '${bizFlag}';
    $(function () {
    	debugger;
        var capPayInfoId = "${capPayInfoVO.id}";//主键ID
        var capPayStsCd = "${capPayInfoVO.payStsCd}";//付款状态
        var prjTypCd = "${capPayInfoVO.prjTypCd}";  //项目类型
        if (capPayStsCd && capPayStsCd != "1" && capPayStsCd != "4") {
            $("#startFlowBtn").hide();
        }

        var pamt = parseInt('${capPayInfoVO.prdAmt}');//设备款
        var initamt = parseInt('${capPayInfoVO.initPayAmt}');//首期款
        var minusamt = parseInt('${capPayInfoVO.minusAmt}');//首期款不含咨询费

        $("#pAmt").text(FormatMoney(pamt / 100));
        $("#initPayAmt").text(FormatMoney(initamt / 100));
        $("#initFstShowAmt").text(FormatMoney((initamt - minusamt) / 100));

        $('#isFstCol').ligerCheckBox();

        <c:if test="${not empty accSize}">
        counts = ${accSize};
        </c:if>
        for (var i = 0; i < counts.length; i++) {
            $('#payeeTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $('#bkAccTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $("#payWayCd" + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
        }
        form = $("#capPayInfo_form").ligerForm({
            validate: true
        });
        
        //================================(汽车金融)车立行==直租开票=============start=============================
        var pkids = '${PrjLnkComp.id}';
        if(prjTypCd=='ZZKP'){
        	 <c:if test="${not empty lnkCompSize}">
             lnkCSize = ${lnkCompSize};
             </c:if>
             
        for (var i = 0; i < lnkCSize.length; i++) {
            $('#payeeTypCd'+(counts.length+i+1)).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $('#bkAccTypCd'+(counts.length+i+1)).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
          }
           
        
        
       for (var j = 0; j < lnkCSize.length; j++) {
    	 var isInsurance=lnkCSize[j];
    	   if(isInsurance=="4"||isInsurance=="5"){
    		   //挂靠公司归属地
               liger.get("payeeTypCd" + (counts.length+j+1)).setData(${payeeTypCdList});
               //账户类型
               liger.get("bkAccTypCd"+ (counts.length+j+1)).setData(${bkAccTypCdList}); 
               
               liger.get("payeeTypCd" + (counts.length+j+1)).setDisabled(true);
               liger.get("bkAccTypCd" + (counts.length+j+1)).setDisabled(true);
               liger.get("rcptUnt" + (counts.length+j+1)).setDisabled(true);
               liger.get("payeeBkNm" + (counts.length+j+1)).setDisabled(true);
               liger.get("payeeBkNo" + (counts.length+j+1)).setDisabled(true);
               liger.get("accNo" + (counts.length+j+1)).setDisabled(true);
    	   }else{
    		   //挂靠公司归属地
               liger.get("payeeTypCd" + (counts.length+j+1)).setData(${kvList3});
               //账户类型
               liger.get("bkAccTypCd"+ (counts.length+j+1)).setData(${kvList4}); 
               
               liger.get("payeeTypCd" + (counts.length+j+1)).setDisabled(true);
               liger.get("bkAccTypCd" + (counts.length+j+1)).setDisabled(true);
               liger.get("rcptUnt" + (counts.length+j+1)).setDisabled(true);
               liger.get("payeeBkNm" + (counts.length+j+1)).setDisabled(true);
               liger.get("payeeBkNo" + (counts.length+j+1)).setDisabled(true);
               liger.get("accNo" + (counts.length+j+1)).setDisabled(true);
    		   
    	   }
    	   
    	   
    	   //选择
           $("#rcptUnt" + counts[j]).click(function (event) {
               var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
               if (!payeeTypCd) {
                   $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
                   return;
               }
              /*  if (payeeTypCd == 3) {
                   return;
               }
               if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                   return;
               } */
            /*    var cstId = $("#cstId").val();//客户ID
               var splId = $("#splId").val();//供应商ID */
               var onOk = function (item, Dialog) {
                   //在子页面里绑定 frameElement.dialog.onOk = function () {}
                   if (Dialog.onOk) Dialog.onOk();
               };
               var onCancel = function (item, Dialog) {
                   //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                   if (Dialog.onCancel) Dialog.onCancel();
               };
               $.ligerDialog.SQopen({
                   width: 850,
                   height: 350,
                   title: '收款账户列表',
                   
                   url: '<%=path%>/capital/capPayInfo/toChoosePayee.do',
                   buttons: [
                       {
                           text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
                       }, {
                           text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                       }
                   ],
                   data: {payeeTypCd: payeeTypCd, pkids: pkids, purpCd: counts[j]}
               });
           });
       })(j);
    	   
          
        } 
             
        }
 //================================(汽车金融)车立行================end============================

        var accCtrl = '${accCtrl}';//收款账号控制
        if (accCtrl === "1") {//不可编辑
            $("#payRem").setDisabled_ligerTextarea(true);
        }
        var entrance = '${entrance}';//付款信息控制

        for (var j = 0; j < counts.length; j++) {
            liger.get("payeeTypCd" + counts[j]).setData(${payeeTypCdList});
            liger.get("bkAccTypCd" + counts[j]).setData(${bkAccTypCdList});
            liger.get("payWayCd" + counts[j]).setData(${payWayCdList});

            if (accCtrl === "1") {//不可编辑
                liger.get("payeeTypCd" + counts[j]).setDisabled(true);
                liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                liger.get("rcptUnt" + counts[j]).setDisabled(true);
                liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                liger.get("accNo" + counts[j]).setDisabled(true);
            } else {
                var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                if (payeeTypCd && payeeTypCd != 3) {
                    liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                    liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                    liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                    liger.get("accNo" + counts[j]).setDisabled(true);
                    // 2017-6-26 15:33:05 jiangzg modify
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        liger.get("payeeTypCd" + counts[j]).setDisabled(true);
                        liger.get("rcptUnt" + counts[j]).setDisabled(true);
                    }
                }
            }

            liger.get("actPayAmt" + counts[j]).setDisabled(true);
            liger.get("actPayTms" + counts[j]).setDisabled(true);
            liger.get("payWayCd" + counts[j]).setDisabled(true);
            liger.get("payAmts" + counts[j]).setDisabled(true);
            if (entrance === '1') {
                liger.get("actPayAmt" + counts[j]).setEnabled();
                liger.get("actPayTms" + counts[j]).setEnabled();
                liger.get("payWayCd" + counts[j]).setEnabled();
            } else if (entrance === '2') {//只编辑收款方应付金额
                if('' != bizFlag && null != bizFlag && '2' == bizFlag){
                    liger.get("payAmts1").setDisabled(true);
                }else{
                    liger.get("payAmts1").setEnabled();
                }
                $("#payAmts1").change(function () {
                    $(document).trigger('click');
                    var amts = $("#payAmts1").val();
                    amts = amts.replace(",", "");
                    $("#payAmt1").val(amts * 100);
                    $("#payAmt").val(amts * 100);
                });
            } else if (entrance === '3') {//只能编辑供应商返利金额
                var payAmts2 = liger.get("payAmts2");
                if (payAmts2) {
                    if('' != bizFlag && null != bizFlag && '2' == bizFlag){
                        payAmts2.setDisabled(true);
                    }else{
                        payAmts2.setEnabled();
                    }
                    $("#payAmts2").change(function () {
                        $(document).trigger('click');
                        var amts = $("#payAmts2").val();
                        amts = amts.replace(",", "");
                        amts = amts * 100;
                        var rebateAmt = $("#rebateAmt2").val();
                        if (amts > rebateAmt) {//编辑的金额不能大于支付表明细供应商返利金额
                            $.ligerDialog.SQalert({
                                content: "供应商返利金额不能大于" + FormatMoney(rebateAmt / 100) + "元",
                                SQ_type: "warning"
                            });
                            var payAmt2 = $("#payAmt2").val();
                            $("#payAmts2").val(FormatMoney(payAmt2 / 100));
                            return;
                        }
                        $("#payAmt2").val(amts);
                    });
                }
            }

            (function (j) {
                $("#payeeTypCd" + counts[j]).change(function () {
                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        return;
                    }
                    $("#rcptUnt" + counts[j]).val("");
                    $("#bkAccTypCd" + counts[j]).val("");
                    $("#payeeBkNm" + counts[j]).val("");
                    $("#payeeBkNo" + counts[j]).val("");
                    $("#accNo" + counts[j]).val("");
                    if (payeeTypCd == 3) {
                        liger.get("bkAccTypCd" + counts[j]).setEnabled();
                        liger.get("payeeBkNm" + counts[j]).setEnabled();
                        liger.get("payeeBkNo" + counts[j]).setEnabled();
                        liger.get("accNo" + counts[j]).setEnabled();
                    } else {
                        liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                        liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                        liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                        liger.get("accNo" + counts[j]).setDisabled(true);
                    }

                });

                //选择
                $("#rcptUnt" + counts[j]).click(function (event) {
                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                    if (!payeeTypCd) {
                        $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
                        return;
                    }
                    if (payeeTypCd == 3) {
                        return;
                    }
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        return;
                    }
                    var cstId = $("#cstId").val();//客户ID
                    var splId = $("#splId").val();//供应商ID
                    var onOk = function (item, Dialog) {
                        //在子页面里绑定 frameElement.dialog.onOk = function () {}
                        if (Dialog.onOk) Dialog.onOk();
                    };
                    var onCancel = function (item, Dialog) {
                        //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                        if (Dialog.onCancel) Dialog.onCancel();
                    };
                    $.ligerDialog.SQopen({
                        width: 850,
                        height: 350,
                        title: '收款账户列表',
                        url: '<%=path%>/capital/capPayeeInfo/toChoosePayee.do',
                        buttons: [
                            {
                                text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
                            }, {
                                text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                            }
                        ],
                        data: {payeeTypCd: payeeTypCd, cstId: cstId, splId: splId, purpCd: counts[j]}
                    });
                });
            })(j);
        }
 
       
        
        /*是否代收首期款*/
        $("#isFstCol").change(function () {
            if (this.checked) {
                $("#payAmts1").val(FormatMoney((pamt - initamt) / 100));//应付款=设备款-首期款
                $("#payAmt1").val(pamt - initamt);
                $("#payAmt").val(pamt - initamt);
            } else {
                $("#payAmts1").val(FormatMoney(pamt / 100));//应付款=设备款
                $("#payAmt1").val(pamt);
                $("#payAmt").val(pamt);
            }
        });

        var ctrlKey = '${ctrlKey}';//上传控制
        pageInTab = $("#pageInTab").ligerTab({
            height: 'auto',
            contextmenu: false,
            minIframeHeight: GET_minIframeHeight(),
            onAfterSelectTabItem: function (tabid) {
                if (loadedTabs.indexOf(tabid) < 0) {
                    loadedTabs.push(tabid);
                    if (tabid != "payTab") {
                        switch (tabid) {
                            case "leaseTab":
                                if (ctrlKey === '3') {
                                    pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toLeaseListPage.do?paySchId=${capPayInfoVO.paySchId}");
                                } else {
                                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toCompPrdInfoListPage.do?dtlId=${capPayInfoVO.prjPrdDtlId}");
                                }
                                break;
                            case "hisTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toHisPayListPage.do?id=${capPayInfoVO.id}&paySchId=${capPayInfoVO.paySchId}");
                                break;
                            case "mateTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toMateListPage.do?id=${capPayInfoVO.id}&payStsCd=${capPayInfoVO.payStsCd}&ctrlKey=${ctrlKey}" +
                                        "&prjPrdDtlId=${capPayInfoVO.prjPrdDtlId}&cstId=${capPayInfoVO.cstId}&prjId=${capPayInfoVO.prjId}&cstMgrOrgCd=${capPayInfoVO.cstMgrOrgCd}&prjTypCd=${capPayInfoVO.prjTypCd}&paySchNo=${capPayInfoVO.paySchNo}");
                                break;
                            case "insTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/insurance/insPlcBscInfo/toPlcListPage.do?paySchId=${capPayInfoVO.paySchId}");
                                break;
                            case "bankTab":
                                <c:choose>
                                    <c:when test="${capPayInfoVO.payStsCd != null && (capPayInfoVO.payStsCd == '2' || capPayInfoVO.payStsCd == '3' || capPayInfoVO.payStsCd == '5')}">
                                        <c:if test="${isAddBank == '1'}">
                                            pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toAddCorpBankInfo.do?paySchId=${capPayInfoVO.paySchId}");
                                        </c:if>
                                        <c:if test="${isAddBank == '0'}"> // toCorpBankInfoDetail
                                            pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toCorpBankInfoDetail.do?paySchId=${capPayInfoVO.paySchId}");
                                        </c:if>
                                    </c:when>
                                    <c:otherwise>
                                        <c:if test="${isAddBank == '1'}">
                                            pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toAddCorpBankInfo.do?paySchId=${capPayInfoVO.paySchId}");
                                        </c:if>
                                        <c:if test="${isAddBank == '0'}">
                                            pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toCorpBankInfoDetail.do?paySchId=${capPayInfoVO.paySchId}");
                                        </c:if>
                                    </c:otherwise>
                                </c:choose>
                                break;
                        }
                    }
                }
                SetIframe_height();
            }
        });

        $.extend(true, pageInApp, {
            pageInTab: pageInTab
        });

        $("#pageloading").hide();

        if (accCtrl === '1' && entrance === '0') {
            $("#saveCapPayInfoBtn").hide();
            $("#backCapPayInfoBtn").hide();
        }

        var buOrgcd = "${capPayInfoVO.buOrgCd}";
        var payeeId1 = $("#payeeId1").val();
        if(buOrgcd==="00000005"&&StringUtils.isNotEmpty(payeeId1)){
            //汽车金融不允许修改收款账户
            liger.get("payeeTypCd1").setDisabled(true);
            liger.get("rcptUnt1").setDisabled(true);
            $('#rcptUnt1').unbind("click"); //移除click
        }

        /*保存*/
        $("#saveCapPayInfoBtn").click(function (event) {
            //$(document).trigger('click');
            opt('<%=path%>/capital/capPayInfo/modify.do?id=' + capPayInfoId, 1);
        });

        /*返回*/
        $("#backCapPayInfoBtn").click(function (event) {
            Remove_navTab();
        });

        /*发起流程*/
        $("#startFlowBtn").click(function (event) {
            //$(document).trigger('click');
            var payTypCd = $('#payTypCd').val();
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: {
                    buOrgCd: '${capPayInfoVO.buOrgCd}',
                    prjTypCd: '${capPayInfoVO.prjTypCd}',
                    paySchId: '${capPayInfoVO.paySchId}',
                    prjPrdDtlId: '${capPayInfoVO.prjPrdDtlId}',
                    prjPrdId: '${capPayInfoVO.prjPrdId}',
                    payTypCd: payTypCd
                },
                url: '<%=path%>/insurance/insTypCfgR/validate.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        var tip = "";
                        if (payTypCd == 1) {
                            tip = "是否确认发起正常放款流程？"
                        } else if (payTypCd == 2) {
                            tip = "是否确认发起提前放款流程？"
                        } else if (payTypCd == 3) {
                            tip = "是否确认发起特殊放款流程？";
                        }
                        $.ligerDialog.confirm(tip, function (flag) {
                            if (flag == false)return;
                            // 17-8-10 by YAOXIURONG 
                            opt('<%=path%>/capital/capPayInfo/payApply.do?id=' + capPayInfoId, 2);
                            //opt('<%=path%>/capital/capPayInfo/payApplyV2.do?id=' + capPayInfoId, 2);
                        });
                    } else {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error", SQ_showButtons: true,});
                    }
                }
            });
        });
    });

	//当前tab刷新
	function callback() {
        window.location.reload();
    }
    /**新增上牌信息*/
    function addSp(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'sp_info_add','添加上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId,callback);
    }
    /**修改上牌信息*/
    function modifySp(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'sp_info_add','修改上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId,callback);
    }
    /**查看上牌信息*/
    function showSp(_prjPrdDtlId){
    	var detailFlag = true;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
    	Add_navTab( 'sp_info_add','查看上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&checkSp=${checkSp}&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId, callback);
    }
    
    function opt(_url, _typ) {
        if (!form.valid()) {
            $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = form.getData();
        data['payeeList'] = JSON.stringify(getFieldsetsValues(fields, counts));

        $.ligerDialog.hide();
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: _url,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    if (_typ == 1) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        var resp = msg.data;
                        for (var i = 0; i < resp.length; i++) {
                            $("#payeeId" + resp[i].key).val(resp[i].value);
                        }
                    }
                    if (_typ == 2) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success", SQ_showButtons: true});
                        //回调刷新列表
                        var callback = frameElement.W2W.callback;
                        Remove_navTab();
                        callback();
                    }
                }else if(msg.success ==2){//找到多个流程
    				//TODO 
    				console.log(msg.data);
    				var __DATA_radioList = msg.data;
					var selectedVal = '';
					var selectDialog = $.ligerDialog.SQopen({
						 width: 300,
						 height: 200,
						 title : '请选择要发起的流程',
						 allowClose: false,
						 content: '<div id="radiolist1"></div>',
						 fixButtons: true, //固定按钮到底部
						 onOk: function () {
						     console.log(selectDialog);
						     console.log(selectedVal);
						     if(StringUtils.isEmpty(selectedVal)){
						    	 $.ligerDialog.SQalert({content: "请选择要发起的流程.", SQ_type: "warning"});
						         return;
						     }else{
							    selectDialog.close();
						    	var wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting",onClose: function () {}});
	    	            		$.ajax({
	    	                		type: 'post',
	    	                		dataType:'json',
	    	                		data: data,
	    	                		url: _url+'&procDefKey='+selectedVal,
	    	                		success:function(msg){
	    	                			 wait_dialog.close();
	    	                			 if(msg.success == 1){//成功发起流程
	    	               					 /* UIUtils.alertSuccessHold1(msg.info);
	    	                				 grid.reload(); */
	    	                				 if (_typ == 1) {
	    	                                     top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
	    	                                     var resp = msg.data;
	    	                                     for (var i = 0; i < resp.length; i++) {
	    	                                         $("#payeeId" + resp[i].key).val(resp[i].value);
	    	                                     }
	    	                                 }
	    	                                 if (_typ == 2) {
	    	                                     top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success", SQ_showButtons: true});
	    	                                     //回调刷新列表
	    	                                     var callback = frameElement.W2W.callback;
	    	                                     Remove_navTab();
	    	                                     callback();
	    	                                 }
	    	                			 }else if(msg.success == 0){//错误
	    	               					 UIUtils.alertErrorHold1(msg.info);
	    	                			 }
	    	                		}
	    	            		})					    	 
						     }
						 }
					});
					$("#radiolist1").ligerRadioList({
					 data: __DATA_radioList,
					 textField: 'procNm',
					 valueField: 'procDefKey',
					 rowSize: 1,
					 onSelect: function (data)
					 {
					     console.log(data);
					     selectedVal = data.value;
					 }
					});
    			 } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error", SQ_showButtons: true});
                }
            }
        });
    }

    //查询客户详情
    function showCstDtl(_cstId) {
        Add_navTab("InsPlcCstBscInfo_" + _cstId, "客户信息", '<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id=' + _cstId, null);
    }

    //项目详情
    function toPrjDetail(_projectId) {
        if (!_projectId)return;
        Add_navTab("prjDetail" + _projectId, "项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?detailFlag=true&id=' + _projectId);
    }

    // 支付表详情
    function showPrjPrdPaySchDtl() {
        var editFlag = true;
        var prjId = '${capPayInfoVO.prjId}';
        var id = '${capPayInfoVO.paySchId}';
        var prjPrdDtlId = '${capPayInfoVO.prjPrdDtlId}';
        var prjPrdId = '${capPayInfoVO.prjPrdId}';
        Add_navTab('tab_prj_quat_prps' + id, '查看支付表', '<%=path%>/project/prjprdpayschm/toAddPage.do?prjId=' + prjId + '&&id=' + id + '&&prjPrdDtlId=' + prjPrdDtlId + '&&prjPrdId=' + prjPrdId + '&&detailFlag=' + editFlag);
    }

    function getFieldsetsValues(fields, count) {
        var fieldsetValues = [];
        for (var i = 0; i < count.length; i++) {
            var values = _getValues(count[i]);
            if (values.bkId == '') {
                continue;
            }
            fieldsetValues.push(values);
        }
        return fieldsetValues;

        function _getValues(i) {
            var values = {};
            $.each(fields, function (index, val) {
                var el = document.getElementById(val + i);
                elID = el.id;
                ligerObj = liger.get(elID);
                value = '';
                if (ligerObj) {
                    value = ligerObj.getValue();
                } else {
                    value = el.value;
                }
                // jzg add 2017-10-17 16:11:11 工行业务
                if(val == 'actPayAmt'){
                    value = value * 100 ;
                }
                values[val] = value;
            });
            return values;
        }
    }

    var _capPayId = '${id}';//付款ID
    var _proIntId = '${proIntId}';//流程实例ID
    var _taskId = '${taskId}';//任务节点ID
    var _taskDefKey = '${taskDefKey}';//任务节点KEY
    var _taskNm = '${taskNm}';//任务节点名称
    function rejOpnStart() {
        var bookTypCd = AuditConstant.AUD_LOAN_BOOK_TYP_CD;//台账类型-放款驳回台账
        var opinionTypeCd = AuditConstant.SYS_FLOW_REJ_RSN_TYP_CD_LOAN;//驳回意见类型-放款驳回
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '驳回意见',
            url: '<%=path%>/audit/audRejectOpinion/toAddPage.do?capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&taskId=' + _taskId + '&taskDefKey=' + _taskDefKey + '&opinionTypeCd=' + opinionTypeCd + '&bookTypCd=' + bookTypCd + '&taskNm=' + _taskNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    var _procNm = '${procNm}';//流程定义名称

    //放款合同通过意见
    function contractOpnStart() {
        var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_CONTRACT;
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '放款合同通过意见',
            url: '<%=path%>/audit/audPayPassOpinion/toModifyPage.do?carAudit=1&capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&opnTypCd=' + _opnTypCd + '&procNm=' + _procNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.preview) Dialog.preview();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }
    
    //放款抵押通过意见
    function mortGageOpnStart() {
        var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_MORTGAGE;
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '放款抵押通过意见',
            url: '<%=path%>/audit/audPayPassOpinion/toModifyPage.do?carAudit=1&capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&opnTypCd=' + _opnTypCd + '&procNm=' + _procNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.preview) Dialog.preview();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

</script>
</body>
</html>
